package com.hfy.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hfy.model.dto.post.CreateFavoriteDto;
import com.hfy.model.dto.post.DoCollectDto;
import com.hfy.model.dto.post.PostPostDto;
import com.hfy.model.po.user.post.PostDraftPo;
import com.hfy.model.po.user.post.PostPo;
import result.Result;

import java.util.Optional;
import java.util.OptionalInt;
import java.util.OptionalLong;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 韩
 * @since 2024-11-28
 */
public interface PostService extends IService<PostPo> {

    Result postPost(Optional<PostPostDto> optional);

    Result getTopics();

    /**
     * 获取帖子的草稿列表
     *
     * @param postId 帖子ID
     * @return 草稿列表
     */
    Result listDraftsByTimes(Integer postId);

    /**
     * 保存草稿
     *
     * @param draft 草稿内容
     * @return 保存结果
     */
    Result saveDraft(PostDraftPo draft);

    Result listAnyPostsByPage(Optional<Integer> lastPostIdOptional, Optional<Integer> pageSizeOptional);

    Result toggleLikePost(Optional<Integer> postIdOptional, Optional<Long> accountOptional);

    Result getPostInfo(Optional<Integer> postIdOptional, Optional<Long> accountOptional);

    Result toggleCollectPost(Optional<DoCollectDto> dtoOptional);

    Result listFavorites(OptionalLong accountOptional, OptionalInt postIdOptional);

    Result createFavorite(Optional<CreateFavoriteDto> dtoOptional);

    Result listMyPosts();

    Result getHotPosts(Optional<Long> accountOptional, Optional<Integer> limitOptional);
}
